package ObjectFn4;

import java.time.Instant;
import java.time.LocalDate;
import java.time.Period;

public class test6 {
    public static void main(String[] args) {
//        Instant now = Instant.now();
//        long epochSecond = now.getEpochSecond(); // 总秒数
////        System.out.println(epochSecond);
////        System.out.println(now.getNano()); // 纳秒值
//        System.out.println(now.getNano() - Instant.now().getNano());
        LocalDate start = LocalDate.of(2029, 8, 10);
        LocalDate end = LocalDate.of(2029, 12, 15);

// 1、创建Period对象，封装两个日期对象。
        Period period = Period.between(start, end);

// 2、通过period对象获取两个日期对象相差的信息。
        System.out.println(period.getYears());
        System.out.println(period.getMonths());
        System.out.println(period.getDays());
    }
}
